'''
goods = [ {"name": "电脑", "price": 1999},
{"name": "鼠标", "price": 10},
{"name": "游艇", "price": 20},
{"name": "美女", "price": 998},
          ]

changes = float(input("Please input your changes:"))

for i in goods:
    print(goods.index(i),i)

basket = []


choice = int(input("Please input your choice:"))

while changes > int(goods[choice]['price']):
    basket.append(choice)
    changes -= int(goods[choice]['price'])
    labelfinal = input("Do you finish? Y/N")
    while labelfinal != 'Y' and labelfinal != 'N' :
        labelfinal = input("Please input the proper answer: Y/N")
    if labelfinal == 'N':
        choice = int(input("Please input your choice:"))
    else:
        break

print("You have finish shopping.")
for i in basket:
    print(goods[choice])
print("You have {} left.".format(changes))
'''
'''
key = {}
for i in range(100):
  key.setdefault(i,i)
print(key)
'''

from scipy.special import comb, perm

print(perm(10,2))   #计算排列数    6

print(comb(10,2))   #计算组合数     3

P = .0
for i in range(13):
    C  = comb(100,i)
    P1 = 0.1 ** i
    P2 = 0.9 ** (100 - i)
    print(C*P1*P2)
    P += C*P1*P2
print(P)
